package ch.fhnw.qualiscan.application.pages;

import ch.fhnw.qualiscan.application.models.AdminModel;
import ch.fhnw.qualiscan.application.models.SurveyModel;
import ch.fhnw.qualiscan.application.pages.tabs.AdminTab1;
import ch.fhnw.qualiscan.application.pages.tabs.AdminTab2;
import ch.fhnw.qualiscan.application.pages.tabs.AdminTab3;
import ch.fhnw.qualiscan.application.pages.tabs.AdminTab4;
import ch.fhnw.qualiscan.application.pages.tabs.AdminTab5;
import ch.fhnw.qualiscan.application.pages.tabs.AdminTab6;
import ch.fhnw.qualiscan.core.Page;

import com.vaadin.ui.TabSheet.Tab;

import eu.livotov.tpt.i18n.TM;

@SuppressWarnings("serial")
public class Admin extends Page {
	
	public AdminModel adminModel;
	public SurveyModel surveyModel;
	
	
	private AdminTab1 tabComponent1;
	private Tab tab1;
	
	public AdminTab2 tabComponent2;
	private Tab tab2;
	
	private AdminTab3 tabComponent3;
	private Tab tab3;
	
	private AdminTab4 tabComponent4;
	private Tab tab4;
	
	private AdminTab5 tabComponent5;
	private Tab tab5;
	
	public AdminTab6 tabComponent6;
	private Tab tab6;

	@Override
	public void buildLayout() {
		addComponent(textHelper.h1(TM.get("admin.title")));
		
		tabComponent1 = new AdminTab1(this);
		tabComponent2 = new AdminTab2(this);
		tabComponent3 = new AdminTab3(this);
		tabComponent4 = new AdminTab4(this);
		tabComponent5 = new AdminTab5(this);
		tabComponent6 = new AdminTab6(this);
		
		tab1 = tabSheet.addTab(tabComponent1, TM.get("admin.tab1.title"), null);
		tab2 = tabSheet.addTab(tabComponent2, TM.get("admin.tab2.title"), null);
		tab3 = tabSheet.addTab(tabComponent3, TM.get("admin.tab3.title"), null);
		tab4 = tabSheet.addTab(tabComponent4, TM.get("admin.tab4.title"), null);
		tab5 = tabSheet.addTab(tabComponent5, TM.get("admin.tab5.title"), null);
		tab6 = tabSheet.addTab(tabComponent6, TM.get("admin.tab6.title"), null);
		
		addComponent(tabSheet);
	}

	@Override
	public void initModelsAndHelpers() {
		adminModel = new AdminModel();
		surveyModel = new SurveyModel();
	}

	@Override
	public void initComponents() {
		
		
	}

	@Override
	public void thirdParameterChanged(String currentUrl) {
		
		
	}
	
	@Override
	public void setNeededPermissions() {
		neededPermissions.add("loggedIn");
		neededPermissions.add("admin");
		
	}

}
